import requests
class IhrmEmpCurd:
    @classmethod
    def add_emp(cls,header,json_data):
        url="http://ihrm-test.itheima.net/api/sys/user"
        resp=requests.post(url=url,headers=header,json=json_data)
        return resp
    @classmethod
    def query_emp(cls,user_id,header):
        url=f"http://ihrm-test.itheima.net/api/sys/user/{user_id}"
        resp=requests.get(url=url,headers=header)
        return resp
    @classmethod
    def revise_emp(cls,user_id,header,json_data):
        url="http://ihrm-test.itheima.net/api/sys/user/{}".format(user_id)
        resp=requests.put(url=url,headers=header,json=json_data)
        return resp
    @classmethod
    def delete_emp(cls,user_id,header):
        url="http://ihrm-test.itheima.net/api/sys/user/{}".format(user_id)
        resp=requests.delete(url=url,headers=header)
        return resp
